package com.cnhis.cloudhealth.clinical.infusion.base.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.cnhis.cloudhealth.clinical.infusion.base.bo.CliSysParametersBo;
import com.cnhis.cloudhealth.clinical.infusion.base.mapper.SysParameters;

/**
 * Created by hdd on 2016/6/13.
 */
@Service
public class ClinicalSysParametersImpl implements IClinicalSysParameters{

    private static Logger logger = Logger.getLogger(SysParameters.class);

    @Autowired
    private CliSysParametersBo clisysParametersBo;

    /**
     * 参数的批量添加
     * @param list
     * @throws Exception
     */
    public void saveSysParameterList(List<SysParameters> list) throws Exception{
        clisysParametersBo.saveSysParameterList(list);
    }

    public void updateSysParameterList(List<Map<String,Object>> list) throws Exception{
        clisysParametersBo.updateSysParameterList(list);
    }

    public void updateSysParameter(Map<String,Object> map) throws Exception{
        clisysParametersBo.updateSysParameter(map);
    }

    /**
     * 查询出所有  病历参数信息
     * @return
     * @throws Exception
     */
    public List<SysParameters> querySysParameter()throws Exception {
        List<SysParameters> list = new ArrayList<SysParameters>();
        list = clisysParametersBo.querySysParameter();
        return list;
    }


    /**
     * 根据  产品id  程序id  编号  查询系统参数
     * @param productid
     * @param programid
     * @param paramno
     * @return
     * @throws Exception
     */
    public SysParameters queryParameterByPara(Map<String,Object> map) throws Exception{
        SysParameters parameters = null;
        if(!"".equals(map) && map != null){
            parameters = clisysParametersBo.queryParameterByPara(map);
        }
        return parameters;
    }

    /**
     * 根据  产品id  程序id  编号  查询系统参数
     * 多个编号    多个参数
     * @return
     * @throws Exception
     */
    public List<SysParameters> queryParamListByParam(Map<String,Object> map) throws Exception{
        List<SysParameters> list = new ArrayList<SysParameters>();
        if(!"".equals(map) && map != null){
            list = clisysParametersBo.queryParamListByParam(map);
        }
        return list;
    }

    /**
	 * 
	 * @Title: querySysParameterRange   
	 * @Description: 查询检索最大天数参数
	 * @param: @return
	 * @param: @throws Exception
	 * @return: int      
	 * @throws
	 */
	public int querySysParameterRange() throws Exception {
		return clisysParametersBo.querySysParameterRange();
	}


}
